package com.ruoyi.kiku.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.kiku.domain.KikuLike;
import com.ruoyi.kiku.mapper.KikuLikeMapper;
import com.ruoyi.kiku.service.IKikuLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 小鞠喜欢事物Service业务层处理
 *
 * @author TT
 * @date 2025-03-03
 */
@Service
public class KikuLikeServiceImpl implements IKikuLikeService
{
    @Autowired
    private KikuLikeMapper kikuLikeMapper;

    /**
     * 查询小鞠喜欢事物
     *
     * @param id 小鞠喜欢事物主键
     * @return 小鞠喜欢事物
     */
    @Override
    public KikuLike selectKikuLikeById(Long id)
    {
        return kikuLikeMapper.selectKikuLikeById(id);
    }

    /**
     * 查询小鞠喜欢事物列表
     *
     * @param kikuLike 小鞠喜欢事物
     * @return 小鞠喜欢事物
     */
    @Override
    public List<KikuLike> selectKikuLikeList(KikuLike kikuLike)
    {
        return kikuLikeMapper.selectKikuLikeList(kikuLike);
    }

    /**
     * 新增小鞠喜欢事物
     *
     * @param kikuLike 小鞠喜欢事物
     * @return 结果
     */
    @Override
    public int insertKikuLike(KikuLike kikuLike)
    {
        kikuLike.setCreateTime(DateUtils.getNowDate());
        return kikuLikeMapper.insertKikuLike(kikuLike);
    }

    /**
     * 修改小鞠喜欢事物
     *
     * @param kikuLike 小鞠喜欢事物
     * @return 结果
     */
    @Override
    public int updateKikuLike(KikuLike kikuLike)
    {
        kikuLike.setUpdateTime(DateUtils.getNowDate());
        return kikuLikeMapper.updateKikuLike(kikuLike);
    }

    /**
     * 批量删除小鞠喜欢事物
     *
     * @param ids 需要删除的小鞠喜欢事物主键
     * @return 结果
     */
    @Override
    public int deleteKikuLikeByIds(Long[] ids)
    {
        return kikuLikeMapper.deleteKikuLikeByIds(ids);
    }

    /**
     * 删除小鞠喜欢事物信息
     *
     * @param id 小鞠喜欢事物主键
     * @return 结果
     */
    @Override
    public int deleteKikuLikeById(Long id)
    {
        return kikuLikeMapper.deleteKikuLikeById(id);
    }
}
